﻿@model ListViewModel<CommonSearchValues, IQueryable<WebUI.Models.aspnet_Users>>
@*@model IEnumerable<WebUI.Models.aspnet_Users>*@
           
@{ var tm = new WebUI.Models.aspnet_Users();}
@*@Html.Partial("SearchPartial", new ViewDataDictionary
{ 
    { "SearchAction", "DrList" },
    { "UpdateTargetId", "DoctorListView" },
    {"NewLinkTitle", "新建医生注册"},
    {"NewLinkAction", "DrEdit"},
    {"NewLinkArg", new { ID = Guid.Empty }},    
    {"DialogTitle", "医生注册"}
})*@
<div class="toolbox">
    
    <div class="catalog-title">  
        @Ajax.ActionLink("新建医生注册", "DrEdit", new { ID = Guid.Empty }, new AjaxOptions() { LoadingElementId = "OnLoadingSpan", UpdateTargetId = "dialogbox", OnComplete = "showDialog('医生信息');", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" })
         &nbsp; &nbsp;
        <a href="javascript:void(0)" onclick="$('#searchpan').toggle('blind');">[查询]</a>
        </div>
    <div id="searchpan" style="display:none;">
        @using (Ajax.BeginForm("DrList", new { IsView = false }, new AjaxOptions { HttpMethod = "Post", LoadingElementId = "OnLoadingSpan", UpdateTargetId = "main", OnFailure = "OnSiteError" }))
        {
            <div class="small-input">               
                <table class="width noborder" style="background-color: #f8f8f8">
                    <tr>
                        <td valign="top">
                            姓名： @Html.EditorFor(m => m.SearchFrom.V1)
                            状态：@Html.DropDownListFor(model => model.SearchFrom.V6, new SelectList(ViewBag.Status, "EnumValID", "OptionTitle", Model.SearchFrom.V6), "全部", null)              
                            &nbsp;&nbsp;&nbsp;手机号码： @Html.EditorFor(m => m.SearchFrom.V2)
                        </td>                       
                        <td align="left" valign="top">
                        &nbsp;&nbsp;&nbsp;医院： @Html.DropDownListFor(m => m.SearchFrom.V3, new SelectList(ViewBag.Hospitals, "HospitalID", "HospName", Model.SearchFrom.V4), "全部", null)<br />
                            &nbsp;&nbsp;&nbsp;科室： @Html.DropDownListFor(m => m.SearchFrom.V5, new SelectList(ViewBag.Binqus, Model.SearchFrom.V5), "全部", null)
                            病区 @Html.DropDownListFor(m => m.SearchFrom.V4, new SelectList(ViewBag.Departments, Model.SearchFrom.V4), "全部", null)
                        </td>
                        <td valign="top">
                            &nbsp;&nbsp;&nbsp; @Helpers.SubmitButton("查询", "qssubmit")
                        </td>
                    </tr>                    
                </table>
            </div>

        }
    </div>
</div>
<table class="width">
    <tr>
        <th>
            @Html.LabelFor(model => tm.UserName)
        </th>
        <th>
            @Html.LabelFor(model => tm.MobileAlias)
        </th>
        <th>
            @Html.LabelFor(model => tm.Hospital)
        </th>
        <th>
            @Html.LabelFor(model => tm.BingQu)
        </th>
        <th>
            @Html.LabelFor(model => tm.Department)
        </th>
        <th>
            @Html.LabelFor(model => tm.IsDoctorDepManager)
        </th>
        <th>
            @Html.LabelFor(model => tm.AccountStatusRef)
        </th>
        <th>
            @Html.LabelFor(model => tm.Gender)
        </th>
        <th>
        </th>
    </tr>
    @{int dColor = 0;
      if(Model==null||Model.Data==null){
          return;
      }
      }

    @foreach (var item in Model.Data)
    {
        <tr class="tr-backColor@(dColor++%2)">
            <td>
                @Html.DisplayFor(modelItem => item.UserName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.MobileAlias)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Hospital.HospName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.BingQu.Title)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Department.DepName)
            </td>
            <td>
                @Html.CheckBox("depManager", item.IsDoctorDepManager, new { disabled = true, @readonly = "readonly" })
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.AccountStatusRef.OptionTitle)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Gender)
            </td>
            <td>
                @Ajax.ActionLink("修改", "DrEdit", new { ID = item.UserId }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "dialogbox", OnComplete = "showDialog('医生信息');", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" })
                @Ajax.ActionLink("删除", "DrDelete", new { ID = item.UserId }, new AjaxOptions() { LoadingElementId="OnLoadingSpan",UpdateTargetId = "DoctorListView", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError", Confirm = OnConfirmDel() })
            </td>
        </tr>
    }
</table>
@Html.Partial("TrHilighter")